import './assets/css/reset.css'
import './assets/css/earth.css'
import 'cesium/Build/Cesium/Widgets/widgets.css'
import './assets/iconfont/iconfont.css'
import { createApp } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'

import IconFont from './components/InconFont/IconFont.vue' // 引入 IconFont 组件
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'

import { ESObjectsManager } from 'earthsdk3'
import { ESUeViewer } from 'earthsdk3-ue'
import { ESCesiumViewer } from 'earthsdk3-cesium'

const app = createApp(App)
const objm = new ESObjectsManager(ESUeViewer, ESCesiumViewer)
//调试
window.g_objm = objm
// 使用app.provide方法在应用级别提供objm
app.provide('objm', objm)

// 全局注册 IconFont 组件
app.component('IconFont', IconFont)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.use(createPinia())
app.use(router)
app.use(ElementPlus, { locale: zhCn })
app.mount('#app')
